package org.budo.cmbc.direct.sdk.entity;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 出金汇款方式查询接口响应对象
 *
 * @author caotao
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class MELEBankRouterQueryResponse extends AbstractCmbcDirectResponse {
    private static final long serialVersionUID = 6518198816451515680L;

    /**
     * 渠道请求流水号
     */
    private String channelJnlNo;

    /**
     * 汇款方式 0=网银互联,1=小额实时支付,2=大额实时支付,3=行内，6=银联代付
     */
    private String payPath;

    /**
     * 清算行行号
     *
     * 如果客户通过大额、小额通道有成功的转账记录，则会返回当时的清算行号和清算行号名称，
     * 以及对应的省、市、总行代码及名称以显示给客户，并可供客户修改，减少客户选择录入时间
     */
    private String payeeClearBankId;

    /**
     * 清算行名称
     */
    private String payeeClearBankName;

    /**
     * 省编码
     */
    private String provinceCode;
    /**
     * 省名称
     */
    private String provinceName;

    /**
     * 市编码
     */
    private String cityCode;

    /**
     * 市名称
     */
    private String cityName;

    private String bankCode;

    private String bankName;

    public MELEBankRouterQueryResponse(String channelJnlNo, String responseJson) {
        super(channelJnlNo, responseJson);

        JSONObject json = JSON.parseObject(responseJson);
        this.channelJnlNo = json.getString("ChannelJnlNo");
        this.payPath = json.getString("PayPath");
        this.payeeClearBankId = json.getString("PayeeClearBankId");
        this.payeeClearBankName = json.getString("PayeeClearBankName");
        this.provinceCode = json.getString("ProvinceCode");
        this.provinceName = json.getString("ProvinceName");
        this.cityCode = json.getString("CityCode");
        this.cityName = json.getString("CityName");
        this.bankCode = json.getString("BankCode");
        this.bankName = json.getString("Bankname");
    }
}
